package com.huangfu.learning.javabase.java.enumeration.enuminterface;

/**
 * Created with IntelliJ IDEA.
 * Author: huangfu.daohui
 * Date: 2018/7/10
 * Time: 9:04
 * Version: 1.0
 * Description:由于Java单继承的原因，enum类并不能再继承其它类，但并不妨碍它实现接口，因此enum类同样是可以实现多接口的
 **/
public enum EnumInterface implements food, sport {
    FOOD,
    SPORT,; //分号分隔


    @Override
    public void eat() {
        System.out.println("吃起来。。。");
    }

    @Override
    public void run() {
        System.out.println("跑起来。。。");
    }

    public static void main(String[] args) {
        EnumInterface.FOOD.eat();
        EnumInterface.SPORT.run();
    }
}

interface food {
    void eat();
}

interface sport {
    void run();
}
